<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/resources/css/admin/main.css"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/resources/css/ztree/metroStyle/metroStyle.css"/>
    <script type="text/javascript" src="<%=request.getContextPath() %>/resources/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/resources/js/ztree/jquery.ztree.core.min.js"></script>
    <script type="text/javascript">
        var setting = {
            view:{
                dblClickExpand: false,
                selectedMulti: false
            },
            async:{
                enable: true,
                url: "treeAs",
                autoParam: ["id=pid"], // 用来指定树的传递参数的 key 的名称
                otherParam: {"ids":"1","name":"test"} // 用来传递其他参数, 演示
            },
            callback:{
                onClick:function(event,treeId,treeNode) {
//                    alert(treeNode.name+","+treeNode.isParent+","+treeNode.test);
                }
            }
        };

        $(function () {
            var tree = $.fn.zTree.init($("#tree"), setting);
        });
    </script>
</head>
<body>
<div id="content">
    <div id="tree" class="ztree">
    </div>
</div>
</body>
</html>